import axios from '@/utils/axios'

/**
 * 发送邮箱验证码
 */
export function sendEmailCode(email) {
  return axios({
    url: '/bandEmail/code?email=' + email,
    method: 'get'
  })
}

/**
 * 输入邮箱验证码，绑定邮箱
 */
export function bandEmail(data) {
  return axios({
    url: '/bandEmail/band',
    method: 'post',
    data
  })
}

/**
 * 发送手机验证码
 */
export function sendPhoneCode(phone) {
  return axios({
    url: '/send/phone',
    method: 'post',
    data: {
      phone: phone
    }
  })
}

/**
 * 绑定手机号
 */
export function bandPhone(data) {
  return axios({
    url: '/user/updatePhone',
    method: 'post',
    data
  })
}
